import numpy as np
x=np.array([3,1,2])
a1=np.argsort(x)
print('a1=',a1)

x=np.array([3,1,2,4])
a2=np.argsort(x)
print('a2=',a2)
x.sort()
print(x)

x=np.random.randint(1,100,10)
print(x)
a3=np.argsort(x)
print('a3=',a3)
x[a3]
print(x)
x[sorted(a3[-5:0])]
print(x)

x=np.array([[0,3,4],[2,2,1]])
a4=np.argsort(x,axis=0)
print('a4=',a4)
a5=np.argsort(x,axis=1)
print('a5=',a5)
x.sort(axis=1)
print(x)
x.sort(axis=0)
print(x)
